﻿using System;
using System.Collections.Generic;
using System.Text;
using Common;

namespace ManagerMachine
{
    public partial class ManagerTable
    {
        public void SendMessageToTableID(int ID_Table,MSG_GSM message,params object[] param)
        {
            Table table = Tables[ID_Table] as Table;
            table.SendMessage(message, param);
        }
        public void SendMessageToTableID(int ID_Table, MSG_GSM message, byte[] param)
        {
            Table table = Tables[ID_Table] as Table;
            table.SendMessage(message, param);
        }
        public void SendMessageToAllTable(MSG_GSM message,params object[] param)
        {
            foreach (Table table in Tables.Values)
            {
                table.SendMessage(message, param);
            }
        }
        public void SendMessageToAllTable(MSG_GSM message, byte[] param)
        {
            foreach (Table table in Tables.Values)
            {
                table.SendMessage(message, param);
            }
        }
        public void SendMessageToAllExceptID(int ID_Table,MSG_GSM message, params object[] param)
        {
            foreach (Table table in Tables.Values)
            {
                if (table.Table_ID == ID_Table)
                    continue;
                table.SendMessage(message, param);
            }
        }
        public void SendMessageToAllExceptID(int ID_Table, MSG_GSM message, byte[] param)
        {
            foreach (Table table in Tables.Values)
            {
                if (table.Table_ID == ID_Table)
                    continue;
                table.SendMessage(message, param);
            }
        }
    }
}
